﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemWFH.Domain;
using SystemWFH.Infrstructer.Interface;

namespace SystemWFH.Infrstructer.Impl
{
    public class ReviewRepository : BaseRepository<Review>, IReviewRepository
    {
        public ReviewRepository(SystemWFHDbContext context) : base(context) { }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="reviewId"></param>
        /// <returns></returns>
        public async Task<int> DeleteAsync(int reviewId)
        {
            try
            {
                return await base.Delete(reviewId);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public async Task<int> DeleteByIdAsync(int id)
        {
            try
            {
                return await base.Delete(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public async Task<List<Review>> GetAllAsync()
        {
            try
            {
                return await base.GetAll();
            }
            catch (Exception)
            {

                throw;
            }
        }

        public async Task<Review> GetByIdAsync(int reviewId)
        {
            try
            {
                return await base.GetValue(reviewId);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public Task<int> ReviewDeletePi(string reviewId)
        {
            throw new NotImplementedException();
        }

        public async Task<int> UpdateAsync(Review review)
        {
            return await base.Update(review);
        }
    }
}
